<table class="layui-table text-center" lay-size="sm">
    <thead>
        <tr>
            <th style="width: 48px">#</th>
            <th>仓库名称</th>
            <th>仓库代码</th>
            <th>默认仓库</th>
            <th>状态</th>
            <th>虚拟仓</th>
            <th>面积</th>
            <th>联系人</th>
            <th>电话</th>
            <th>地址</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {volist name="list" id="item"}
            <tr>
                <td>{$key+1}</td>
                <td>{$item.name}</td>
                <td class="copy-text">{$item.code}</td>
                <td>
                    {php}$is_default = $item['is_default'];{/php}
                    <a href="{:url('save',['warehouse_id'=>$item['warehouse_id'], 'is_default'=>abs(1-$is_default)])}" class="ajax-get" msg="0" style="font-size: 16px;">
                        {$is_default?'<i class="fa fa-unlock"></i>':'<i class="fa fa-lock text-red"></i>'}</a>
                </td>
                <td>
                    {php}$status = $item['status'];{/php}
                    <a href="{:url('save',['warehouse_id'=>$item['warehouse_id'], 'status'=>abs(1-$status)])}" class="ajax-get" msg="0" style="font-size: 16px;">
                        {$status?'<i class="fa fa-unlock"></i>':'<i class="fa fa-lock text-red"></i>'}</a>
                </td>
                <td>
                    {php}$virtual = $item['is_virtual'];{/php}
                    <a href="{:url('save',['warehouse_id'=>$item['warehouse_id'], 'is_virtual'=>abs(1-$virtual)])}" class="ajax-get" msg="0" style="font-size: 16px;">
                        {$virtual?'<i class="fa fa-unlock"></i>':'<i class="fa fa-lock text-red"></i>'}</a>
                </td>
                <td>{if $item.area}{$item.area}平方{/if}</td>
                <td>{$item.contacts}</td>
                <td>{$item.phone}</td>
                <td>{$item.address}</td>
                <td><a href="{:url('add',['warehouse_id'=>$item['warehouse_id']])}" class="layui-btn layui-btn-xs layui-btn-normal ajax-form" title="仓库">编辑</a>
                    <a href="{:url('delete',['ids'=>$item['warehouse_id']])}" title="删除" confirm="1" class="layui-btn layui-btn-xs layui-btn-danger ajax-get">删除</a> </td>
            </tr>
        {/volist}
        {empty name="list"}
        <tr>
            <td colspan="9">没有数据</td>
        </tr>
        {/empty}
    </tbody>
</table>